package com.oa.admin.service;

import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.IService;
import com.joneying.common.web.response.Resp;
import com.oa.admin.dto.LeaveApplyAddDTO;
import com.oa.admin.dto.LeaveApplyListDTO;
import com.oa.admin.entity.LeaveApply;
import com.oa.admin.vo.LeaveApplyDetailsVO;
import com.oa.admin.vo.LeaveApplyListVO;
import com.oa.core.PageResult;
import com.oa.core.exception.BusinessException;
import com.oa.core.exception.DataIsEmptyException;

import javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.List;

public interface ILeaveApplyService extends IService<LeaveApply> {

    PageResult<LeaveApplyListVO> findLeaveApplyList(LeaveApplyListDTO leaveApplyListDTO);

    LeaveApplyDetailsVO findLeaveApplyDetails(String id);

    Resp add(String userId, LeaveApplyAddDTO leaveApplyAddDTO) throws BusinessException, DataIsEmptyException;

    Resp audit(String id, String applyApprovalId, Integer status) throws DataIsEmptyException, BusinessException;

    void export(LeaveApplyListDTO leaveApplyListDTO, HttpServletResponse response);

    Double calculationDay(Date beginTime, Date endTime);
}
